package FactoryDemo;

public class ClientClass {
    public static void main(String[] args) {
        Factory factory = (Factory) XMLUtil.getBean();
        assert factory != null;
        Fruit fruit = factory.createFruit();
        fruit.eat();

    }
    public String Factory(String Fruitname) {
        if (Fruitname.equals("Apple")) {
            return "Apple";
        }
        if (Fruitname.equals("Banana")) {
            return "Banana";
        }
        return null;
    }
}
